package com.woniuxy.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Value;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: linKe
 * @Date: 2021/12/3 9:59
 * @FileName: BaseEntity
 * @version: 1.0
 * @Description: 描述
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增ID")
    @Value("2222")
    @TableId(value = "id", type = IdType.AUTO)
    public String id;

    @ApiModelProperty (value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    /* @JsonFormat (timezone = "GMT+8", pattern = "yyyy-MM-dd")*/
    public Date createBy;

    @ApiModelProperty (value = "更新时间")
    @TableField (fill = FieldFill.INSERT_UPDATE)
    /*@JsonFormat (timezone = "GMT+8", pattern = "yyyy-MM-dd")*/
    public Date updateBy;
}